<!-- fileName: PrivateContent -->
<template>
  <div>
    <entry-title>独家放送</entry-title>
    <el-row>
      <el-col :key="index" :span="8" v-for="(item, index) in privateContent">
        <div class="playIconBg">
          <img :src="playIconSrc" class="playIcon"/>
        </div>
        <img :src="item.sPicUrl + '?param=290y170'"
             class="playBgImg"/>
        <div class="text-overflow" style="width: 100%;">
          <span style="font-size: 14px; ">{{ item.name }}</span>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script lang="ts">
  import { discoverApi } from '@/api/discover'
  import playIconSrc from '@/assets/img/discover/play-icon.png'

  export default {
    data() {
      return {
        playIconSrc,
        privateContent: []
      }
    },
    created() {
      this.getPrivateContent()

    },
    methods: {

      async getPrivateContent() {
        // const { data: res } = await this.$http.get('https://autumnfish.cn/personalized/privatecontent')
        discoverApi().getPrivateContent().then(res => {
          this.privateContent = res.result
        })
      }
    }
  }
</script>

<style lang="less" scoped>
  .playIcon {
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 5;
    width: 20px;
    height: 20px;
  }

  .playBgImg {
    width: 24.4vw;
    height: 13.4vw;
    border-radius: 5px;
  }

  .playIconBg {
    background-color: rgba(0, 0, 0, .2);
    width: 25px;
    height: 25px;
    top: 8px;
    left: 8px;
    position: absolute;
    z-index: 5;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, .5);
  }
</style>
